<html><head><title>component.html.ViewStack</title><link rel="stylesheet" type="text/css" href="../../../styles/main.css"><link rel="stylesheet" type="text/css" href="../../../styles/prettify.css"><script language=JavaScript src="../../../javascript/prettify.js"></script><script language=JavaScript src="../../../javascript/main.js"></script></head><body class="FramedContentPage" onLoad="{NDOnLoad();prettyPrint();}"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>

<!--  Generated by Natural Docs, version 1.4 -->
<!--  http://www.naturaldocs.org  -->

<!-- saved from url=(0026)http://www.naturaldocs.org -->




<div id=Content><div class="CClass"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="component.html.ViewStack"></a>component.<wbr>html.<wbr>ViewStack</h1><div class=CBody><p>extends <a href="../../api/VisualElement-js.html#api.VisualElement" class=LClass id=link6 onMouseOver="ShowTip(event, 'tt1', 'link6')" onMouseOut="HideTip('tt1')">api.VisualElement</a></p><p>This is simple implementation of container with states. when is invoked <a href="#component.html.ViewStack.setState" class=LFunction id=link7 onMouseOver="ShowTip(event, 'tt3', 'link7')" onMouseOut="HideTip('tt3')">setState</a> then the old view of the old state is removed and the new view is added to this container</p><h4 class=CHeading>usage</h4><blockquote><pre class="prettyprint">var stack = new component.html.ViewStack();
stack.registerState('landingPage', new myproject.states.LandingPage());
stack.registerState('registerPage', new myproject.states.RegisterPage());
stack.registerState('loginPage', new myproject.states.LoginPage());

stack.setState('loginPage');</pre></blockquote><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#component.html.ViewStack" >component.<wbr>html.<wbr>ViewStack</a></td><td class=SDescription>extends <a href="../../api/VisualElement-js.html#api.VisualElement" class=LClass id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">api.VisualElement</a></td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#component.html.ViewStack.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#component.html.ViewStack.ViewStack" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">ViewStack</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#component.html.ViewStack.setState" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">setState</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#component.html.ViewStack.registerState" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">registerState</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#component.html.ViewStack.unregisterState" id=link5 onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">unregisterState</a></td><td class=SDescription>if stateName is not been registered before nothing happens</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="component.html.ViewStack.Functions"></a>Functions</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="component.html.ViewStack.ViewStack"></a>ViewStack</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>ViewStack : function()</td></tr></table></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="component.html.ViewStack.setState"></a>setState</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>setState : function(</td><td class=PParameter nowrap>value</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="component.html.ViewStack.registerState"></a>registerState</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>registerState : function(</td><td class=PParameter nowrap>stateName,</td></tr><tr><td></td><td class=PParameter nowrap>stateView</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>params</h4><ul><li>stateName is the name of the state view</li><li>stateView is instance of VE</li></ul></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="component.html.ViewStack.unregisterState"></a>unregisterState</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>unregisterState : function(</td><td class=PParameter nowrap>stateName</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>if stateName is not been registered before nothing happens</p></div></div></div>

</div><!--Content-->



<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CClass>Base data class and client context of the Visual Element presented on the screen.</div></div><div class=CToolTip id="tt2"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>ViewStack : function()</td></tr></table></blockquote></div></div><div class=CToolTip id="tt3"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>setState : function(</td><td class=PParameter nowrap>value</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div><div class=CToolTip id="tt4"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>registerState : function(</td><td class=PParameter nowrap>stateName,</td></tr><tr><td></td><td class=PParameter nowrap>stateView</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div><div class=CToolTip id="tt5"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>unregisterState : function(</td><td class=PParameter nowrap>stateName</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>if stateName is not been registered before nothing happens</div></div><!--END_ND_TOOLTIPS-->

<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>